package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;

import bean.JTextFieldValidator;


public class JFFraseIntermedio extends javax.swing.JFrame {
	private JPanel pnlfraseintermedia;
	private JTextFieldValidator txt1;
	private JLabel lblcodigo;
	private JLabel lbl2;
	private JButton btnaceptar;
	private JLabel lbl1;
	private JTextFieldValidator txt5;
	private JTextFieldValidator txt4;
	private JTextFieldValidator txt3;
	private JTextFieldValidator txt2;

	
	public JFFraseIntermedio() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Frase Nivel Intermedio");
			{
				pnlfraseintermedia = new JPanel();
				getContentPane().add(pnlfraseintermedia, BorderLayout.CENTER);
				pnlfraseintermedia.setLayout(null);
				pnlfraseintermedia.setPreferredSize(new java.awt.Dimension(595, 262));
				{
					txt1 = new JTextFieldValidator(JTextFieldValidator.SOLO_LETRAS);
					pnlfraseintermedia.add(txt1);
					txt1.setBounds(19, 83, 120, 30);
					txt1.setFont(new java.awt.Font("Purisa",1,14));
				}
				{
					txt2 = new JTextFieldValidator(JTextFieldValidator.SOLO_LETRAS);
					pnlfraseintermedia.add(txt2);
					txt2.setBounds(151, 83, 120, 30);
					txt2.setFont(new java.awt.Font("Purisa",1,14));
				}
				{
					txt3 = new JTextFieldValidator(JTextFieldValidator.SOLO_LETRAS);
					pnlfraseintermedia.add(txt3);
					txt3.setBounds(287, 83, 120, 30);
					txt3.setFont(new java.awt.Font("Purisa",1,14));
				}
				{
					txt4 = new JTextFieldValidator(JTextFieldValidator.SOLO_LETRAS);
					pnlfraseintermedia.add(txt4);
					txt4.setBounds(427, 83, 120, 30);
					txt4.setFont(new java.awt.Font("Purisa",1,14));
				}
				{
					txt5 = new JTextFieldValidator(JTextFieldValidator.SOLO_LETRAS);
					pnlfraseintermedia.add(txt5);
					txt5.setBounds(556, 83, 120, 30);
					txt5.setFont(new java.awt.Font("Purisa",1,14));
				}
				{
					lbl1 = new JLabel();
					pnlfraseintermedia.add(lbl1);
					lbl1.setText("Indroduzca la Frase:");
					lbl1.setBounds(33, 31, 229, 27);
					lbl1.setFont(new java.awt.Font("Purisa",1,16));
				}
				{
					btnaceptar = new JButton();
					pnlfraseintermedia.add(btnaceptar);
					btnaceptar.setText("Aceptar");
					btnaceptar.setFont(new java.awt.Font("Purisa",1,14));
					btnaceptar.setBounds(299, 195, 100, 30);
				}
				{
					lbl2 = new JLabel();
					pnlfraseintermedia.add(lbl2);
					lbl2.setText("Debe Introducir de Dos(2) a Cinco(5) Palabras");
					lbl2.setFont(new java.awt.Font("Purisa",0,10));
					lbl2.setBounds(213, 134, 322, 15);
				}
				{
					lblcodigo = new JLabel();
					pnlfraseintermedia.add(lblcodigo);
					lblcodigo.setText("2");
					lblcodigo.setBounds(600, 21, 21, 19);
					lblcodigo.setVisible(false);
				}
			}
			pack();
			this.setSize(701, 288);
		} catch (Exception e) {
		 
			e.printStackTrace();
		}
	}

	public JTextFieldValidator getTxt1() {
		return txt1;
	}
	public void setTxt1(JTextFieldValidator txt1) {
		this.txt1 = txt1;
	}
	public JLabel getLblcodigo() {
		return lblcodigo;
	}
	public void setLblcodigo(JLabel lblcodigo) {
		this.lblcodigo = lblcodigo;
	}
	public JTextFieldValidator getTxt5() {
		return txt5;
	}
	public void setTxt5(JTextFieldValidator txt5) {
		this.txt5 = txt5;
	}
	public JTextFieldValidator getTxt4() {
		return txt4;
	}
	public void setTxt4(JTextFieldValidator txt4) {
		this.txt4 = txt4;
	}
	public JTextFieldValidator getTxt3() {
		return txt3;
	}
	public void setTxt3(JTextFieldValidator txt3) {
		this.txt3 = txt3;
	}
	public JTextFieldValidator getTxt2() {
		return txt2;
	}
	public void setTxt2(JTextFieldValidator txt2) {
		this.txt2 = txt2;
	}
	public void mostrarMensaje(String mensaje)
	{
		JOptionPane.showMessageDialog(this, mensaje);
	}
	public void Limpiar()
	{
		txt1.setText(" ");
		txt2.setText(" ");
		txt3.setText(" ");
		txt4.setText(" ");
		txt5.setText(" ");
	}
	public void addListener (ActionListener actionListener)
	{
		this.btnaceptar.addActionListener(actionListener);
	}
}
